const baseURL = 'http://10.31.155.4:3000/api'

	
export default function ajax(config){
	uni.showLoading({
		title:'加载中···'
	})
	
	const {url='',method='get',data={},header={}}=config
	
		
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseURL+url,
			data,
			method,
			header,
			success(res) {
				resolve(res.data)
			},
			fail(err) {
				reject(err)
			},
			complete() {
				uni.hideLoading()
			}
		})
	})
}